package com.ny.mapper;
import com.ny.entity.Classrooms;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
public interface ClassRoomMapper {
    List<Classrooms> findAllClassrooms();

// 多条件查询
    List<Classrooms> searchClassrooms(
            @Param("classroomName") String classroomName,
            @Param("capacity") String capacity,
            @Param("status") String status,
            @Param("building") String building,
            @Param("description") String description);
    @Update(" UPDATE classrooms SET status = #{status} WHERE classroom_id = #{classroomId}")
    void updateClassroomStatusById(@Param("classroomId") int classroomId, @Param("status") String status);
    @Select(" SELECT classroom_name,building,capacity,status FROM classrooms")
    List<Classrooms> findClassrooms(@Param("classroomName") String classroomName,
                                    @Param("building") String building,
                                    @Param("capacity") String capacity,
                                    @Param("status") String status);
}
